import { AnyAction } from 'redux';

type State = {
    loading: boolean;
};

const initialState: State = {
    loading: false,
};

export default (state = initialState, action: AnyAction) => {
    switch (action.type) {
        case 'SET_LOADING': {
            return { ...state, loading: action.loading };
        }
        default:
            return state;
    }
};
